#ifndef __RC_DRIVER_H__
#define __RC_DRIVER_H__

#include <string>
#include <map>
#ifndef yyscan_t
typedef void* yyscan_t ;
#endif
typedef std::map<std::string , std::string> elem_t; // 计费元素
typedef std::map<std::string , std::string>::iterator elem_iterator_t; // 计费元素
class rc_driver
{
  public:
  rc_driver();
  virtual ~rc_driver();

  int parse(const std::string& f , struct ast** a);
  int parse_string(const std::string& str , struct ast** a);
  static int check(const elem_t& e , struct ast* a);
  static int eval(const elem_t& e , struct ast* a , int* val);
  
  int scan_begin();
  void scan_end();
  int scan_tracing(void* scanner ,bool tracing_flag);

  public:
  bool is_trace_parsing;
  bool is_trace_scanning;
  char input_type;
  private :
  std::string file;
  std::string string;
  yyscan_t yyscanner;

};

#endif //__RC_DRIVER_H__

